package com.rati.usercenter.utils;

import com.rati.usercenter.common.BaseResponse;
import com.rati.usercenter.common.ErrorCode;

/**
 * 统一返回工具类
 *
 * @author Lwh
 * @time 2022/12/14 17:32
 */
public class ResultUtils {

    public static <T> BaseResponse<T> success(T data) {
        return new BaseResponse<>(data, ErrorCode.SUCCESS);
    }

    public static <T> BaseResponse<T> fail(ErrorCode errorCode, String description) {
        return new BaseResponse<>(errorCode, description);
    }

    public static <T> BaseResponse<T> error(ErrorCode errorCode, String description) {
        return new BaseResponse<>(errorCode, description);
    }

}
